package com.dkhseep.bigevent.validation;

import com.dkhseep.bigevent.anno.State;
import jakarta.validation.ConstraintValidator;
import jakarta.validation.ConstraintValidatorContext;

/**
 * 功能:
 * 作者:Dksheep
 * 日期:2024/10/1115:51
 */

public class StateValidation implements ConstraintValidator<State,String> {
    @Override
    public boolean isValid(String value, ConstraintValidatorContext constraintValidatorContext) {
        if(value==null)
            return false;
        if(value.equals("草稿")||value.equals("已发布"))
            return true;
        return false;
    }
}
